package com.sms.service.impl;

import com.sms.dao.CourseInfoMapper;
import com.sms.pojo.CourseInfo;
import com.sms.service.CourseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lhj
 */
@Service
public class CourseInfoServiceImpl implements CourseInfoService {

    @Autowired
    private CourseInfoMapper courseInfoMapper;


    @Override
    public Integer insertCourse(CourseInfo courseInfo) {
        Integer row = courseInfoMapper.insertCourse(courseInfo);
        return row;
    }

    @Override
    public Integer updateCourse(CourseInfo courseInfo) {
        Integer row = courseInfoMapper.updateCourse(courseInfo);
        return row;
    }

    @Override
    public Integer deleteCourse(Integer courseId) {
        Integer row = courseInfoMapper.deleteCourse(courseId);
        return row;
    }

    @Override
    public List<CourseInfo> selectCourseAll() {
        List<CourseInfo> courseInfoList = courseInfoMapper.selectCourseAll();
        return courseInfoList;
    }

    @Override
    public CourseInfo selectCourseOne(Integer courseId) {
        CourseInfo courseInfo = courseInfoMapper.selectCourseOne(courseId);
        return courseInfo;
    }

    @Override
    public CourseInfo selectCourseName(String courseName) {
        CourseInfo courseInfo = courseInfoMapper.selectCourseName(courseName);
        return courseInfo;
    }
}
